package com.wujing.scala.first5day


/**
 * for 循环的控制
 *
 *
 *
 */
object OperationDemo8 {

  def main(args: Array[String]): Unit = {

    val start = 1
    val end = 10

    //for 循环的推到也可以直接对集合
    for (i <- start to end) {
      println(" hello  " + i)
    }


    val list = List("hello", 12, 13, "hi")
    list.foreach(item => {
      println(item)
    })


    //循环守护 如果为true   类似于  continue
    for (i <- start to end if i != 2) {
      println(" hello  " + i)
    }

  }

}
